// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_MATERIAL_EX
// * CreateDate    : 2014-06-05 18:30:15
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:15
// * LastChanger   : 2014-06-05 18:30:15
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class MstMaterialExEntity : EntityBase
    {
        public MstMaterialExTable TableSchema
        {
            get
            {
                return MstMaterialExTable.Current;
            }
		}
		
		public MstMaterialExEntity()
        {

        }
		
		public MstMaterialExEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.Source = Convert.ToInt32(CommonFunctions.ToObject(dr["SOURCE"]));
			this.LotSize = Convert.ToDecimal(CommonFunctions.ToObject(dr["LOT_SIZE"]));
			this.OrderMin = Convert.ToDecimal(CommonFunctions.ToObject(dr["ORDER_MIN"]));
			this.OrderMul = Convert.ToDecimal(CommonFunctions.ToObject(dr["ORDER_MUL"]));
			this.LeadTime = Convert.ToInt32(CommonFunctions.ToObject(dr["LEAD_TIME"]));
			this.VleadTime = Convert.ToInt32(CommonFunctions.ToObject(dr["VLEAD_TIME"]));
			this.SafeStock = Convert.ToDecimal(CommonFunctions.ToObject(dr["SAFE_STOCK"]));
			this.MpsFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["MPS_FLAG"]));
			this.PhFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["PH_FLAG"]));
        }
		
		public MstMaterialExEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.Source = Convert.ToInt32(CommonFunctions.ToObject(dr["SOURCE"]));
			this.LotSize = Convert.ToDecimal(CommonFunctions.ToObject(dr["LOT_SIZE"]));
			this.OrderMin = Convert.ToDecimal(CommonFunctions.ToObject(dr["ORDER_MIN"]));
			this.OrderMul = Convert.ToDecimal(CommonFunctions.ToObject(dr["ORDER_MUL"]));
			this.LeadTime = Convert.ToInt32(CommonFunctions.ToObject(dr["LEAD_TIME"]));
			this.VleadTime = Convert.ToInt32(CommonFunctions.ToObject(dr["VLEAD_TIME"]));
			this.SafeStock = Convert.ToDecimal(CommonFunctions.ToObject(dr["SAFE_STOCK"]));
			this.MpsFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["MPS_FLAG"]));
			this.PhFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["PH_FLAG"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return MstMaterialExTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string MaterialId
        {
            get { return Convert.ToString(GetData(MstMaterialExTable.C_MATERIAL_ID)); }
            set { SetData(MstMaterialExTable.C_MATERIAL_ID, value); }
        }
		
        [DataMember]
        public string MaterialCode
        {
            get { return Convert.ToString(GetData(MstMaterialExTable.C_MATERIAL_CODE)); }
            set { SetData(MstMaterialExTable.C_MATERIAL_CODE, value); }
        }
		
        [DataMember]
        public int Source
        {
            get { return Convert.ToInt32(GetData(MstMaterialExTable.C_SOURCE)); }
            set { SetData(MstMaterialExTable.C_SOURCE, value); }
        }
		
        [DataMember]
        public decimal LotSize
        {
            get { return Convert.ToDecimal(GetData(MstMaterialExTable.C_LOT_SIZE)); }
            set { SetData(MstMaterialExTable.C_LOT_SIZE, value); }
        }
		
        [DataMember]
        public decimal OrderMin
        {
            get { return Convert.ToDecimal(GetData(MstMaterialExTable.C_ORDER_MIN)); }
            set { SetData(MstMaterialExTable.C_ORDER_MIN, value); }
        }
		
        [DataMember]
        public decimal OrderMul
        {
            get { return Convert.ToDecimal(GetData(MstMaterialExTable.C_ORDER_MUL)); }
            set { SetData(MstMaterialExTable.C_ORDER_MUL, value); }
        }
		
        [DataMember]
        public int LeadTime
        {
            get { return Convert.ToInt32(GetData(MstMaterialExTable.C_LEAD_TIME)); }
            set { SetData(MstMaterialExTable.C_LEAD_TIME, value); }
        }
		
        [DataMember]
        public int VleadTime
        {
            get { return Convert.ToInt32(GetData(MstMaterialExTable.C_VLEAD_TIME)); }
            set { SetData(MstMaterialExTable.C_VLEAD_TIME, value); }
        }
		
        [DataMember]
        public decimal SafeStock
        {
            get { return Convert.ToDecimal(GetData(MstMaterialExTable.C_SAFE_STOCK)); }
            set { SetData(MstMaterialExTable.C_SAFE_STOCK, value); }
        }
		
        [DataMember]
        public int MpsFlag
        {
            get { return Convert.ToInt32(GetData(MstMaterialExTable.C_MPS_FLAG)); }
            set { SetData(MstMaterialExTable.C_MPS_FLAG, value); }
        }
		
        [DataMember]
        public int PhFlag
        {
            get { return Convert.ToInt32(GetData(MstMaterialExTable.C_PH_FLAG)); }
            set { SetData(MstMaterialExTable.C_PH_FLAG, value); }
        }
		
		#endregion
	}
	
	
}	

